-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1772599: Handle compressed images for libvirt and baremetal IPI #2657
Bug 1772599: Handle compressed images for libvirt and baremetal IPI #2657
Conversation
/hold This has a bit more stuff in it than it should. |
275d093
to
ab0cab4
Compare
/hold cancel Removed the extraneous stuff. |
even previously the cache was uncompressing the data, although implicitly. why not update the cache to make sure it uncompresses the image always..? This is not ideal as every comsumer needs to decompress when the cache should do it as expected. |
+1 This also affects the baremetal IPI platform as we use the QEMU image for our bootstrap:
We will also need to have a change there to fix it. It would be nice if the cache just held the uncompressed image already, can any platform take the gzipped? libvirt can't, and it appears openstack can't... so is there a reason to keep it around? |
Does anyone know why we're gzipping a qcow image, instead of making sure the image itself is fully compressed and sparisfied? |
Looks good, but I agree we need a solution for IPI baremetal and it would be nice if the decompression logic could be abstracted behind the existing cache interfaces so each platform doesn't have to care explicitly about it. |
I think @yuqi-zhang and @miabbott have the history here. |
I can weigh in here. We've always gzip'd the images but previously we did not have the |
To add a bit, the coreos-assembler generates a qcow image from a base ostree, which is the base for all other images. These are then all zipped in the RHCOS pipeline before uploading. If you feel that the compression schema should be changed, that should probably come as an RFE since we haven't really explored it. |
I agree, doing this in the cache makes the most sense. |
fedora coreos is using And therefore i think i would like to keep the uncompressing part hidden into the downloading-caching code. |
That hasn't been our experience for IPI baremetal FWIW - we've been downloading the openstack qcow2 for several months directly, and not gunzipped it until now:
We had to explicitly unzip it ref openshift/ironic-rhcos-downloader#12 and also it seems the HTTP headers provided changed as well ref openshift/ironic-rhcos-downloader#13 |
I agree and I'm working on that. |
Latest commit does decompression transparently in the cache (inspecting the file if it already exists). This simplifies everything. |
9d58bdc
to
f51bf94
Compare
f51bf94
to
a89036c
Compare
@abhinavdahiya please re-review, after which I'll collapse the changes. |
8e359ee
to
389b4d8
Compare
@abhinavdahiya rdy; |
looks good @RobertKrawitz I think we can squash and move ahead. |
|
||
reader = io.MultiReader(bytes.NewReader(buf), reader) | ||
fileType := http.DetectContentType(buf) | ||
logrus.Debugf("content type of %s is %s", filePath, fileType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the output looks like is printing the entire os.File object.
maybe Detected content-type as <type>
?? because we are no longer using the file to detect content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filePath is the filename. I think it's useful this way, so if something goes wrong somebody can look in the cache to see which file was misdetected or whatnot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(that failure was old, when I had file rather than filePath in there)
389b4d8
to
d9955c2
Compare
@RobertKrawitz: This pull request references Bugzilla bug 1772599, which is valid. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
/hold cancel |
1 similar comment
/hold cancel |
@stbenjam @abhinavdahiya please re-review and lgtm if appropriate. |
/approve |
@stbenjam (or someone) could you /lgtm please? |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, cgwalters, hexfusion, RobertKrawitz, stbenjam The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
This accords with normal practice. The client normally decodes the transferred object in accord with the |
@RobertKrawitz: All pull requests linked via external trackers have merged. Bugzilla bug 1772599 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Handle compressed images in all platforms using locally-downloaded images.
xref #2645